#include <stdio.h>
#include <stdlib.h>
 /* f(n) = f(n-2) + f(n-1)	f(1) = 1 f(2) = 1
 1 1 2 3 5
 */
 
 int f[100];
 int f1[100];

 int func(int i)
 {
 	if(i <= 1){
 		return i; 
	 }
	if(f[i] != 0){
		return f[i];	
	}
	else {
		f[i] = func(i-1) + func(i-2);
		return f[i]; 
	}
 }
 
 void func2(int i)
 {
 	f1[0] = 1;
 	f1[1] = 1;
 	for(int j = 2; j < i; j++){
 		f1[i] = f1[i-1] + f1[i-2];
	 }
 }
 
int main(void)
{
	int num = 0; 
	num = func(5);
	printf("f = %d\n", num);
	func2(5);
	
	printf("f1 = %d\n", f1[4]);
	
	return 0;
 } 
 
